package com.pmcc.core.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pmcc.utils.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 人员权限
 * Created by tomas on 2018/4/9.
 */

@Entity
@Table(name = "sys_employee")
public class Employee extends UUIDEntity {
    @Column(name = "name")
    private String name;//姓名
    @Column(name = "avatar")
    private String avatar;
    @Column(name = "user_name", length = 50, unique = true)
    private String userName;//用户名
    @Column(name = "password")
    private String password;//密码
    @Column(name = "address")
    private String address;//详细地址
    @Column(name = "cellphone")
    private String cellphone;//手机号
    @Column(name = "last_login_time")
    private Date lastLoginTime;//上次登录时间
    @Column(name = "enabled")
    private String enabled; //0启用 1禁用
    @Column(name = "create_id")
    private String createId;//创建人ID
    @Column(name = "creator")
    private String creator;//创建人名称
    @Column(name = "create_time")
    private Date createTime;//创建时间
    @Column(name = "del_flag")
    private Integer delFlag;//删除标记
    @Column(name = "role_id")
    private String roleId;//角色id    登录时用
    @Column(name = "sale_man")
    private Boolean saleMan;//是否是业务员（校验是以此字段为主，因为在页面修改的时候不一定会修改角色，如果角色不修改，则还是原来的角色）

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    @JsonSerialize(using = DateTimeFormat.class)
    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getEnabled() {
        return enabled;
    }

    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }

    public String getCreateId() {
        return createId;
    }

    public void setCreateId(String createId) {
        this.createId = createId;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Boolean getSaleMan() {
        return saleMan;
    }

    public void setSaleMan(Boolean saleMan) {
        this.saleMan = saleMan;
    }
}